package com.vogue.supplymall.order.common;

import com.vogue.supplymall.common.domain.dto.UpdatePrepay;

/**
 * The type Check prepay info utils.
 *
 * @author zhangliang
 * Create in 2018-08-23
 */
public final class CheckPrepayInfoUtils {

    private CheckPrepayInfoUtils() {
    }

    /**
     * Check update prepay for cld parameter boolean.
     * 注：pname需要
     *
     * @param updatePrepay the update prepay
     * @return the boolean
     */
    public static Boolean checkUpdatePrepayForCldParameter(UpdatePrepay updatePrepay) {
        return updatePrepay.getSellSyscode() == null
                || updatePrepay.getSellmatchid() == null
                || updatePrepay.getBuySyscode() == null
                || updatePrepay.getBuymatchid() == null
                || updatePrepay.getAmount() == null
                || updatePrepay.getType() == null
                || updatePrepay.getArapbillid() == null
                || updatePrepay.getSerialNum() == null;
    }

    /**
     * Check create prepay for cld parameter boolean.
     * 注：pname需要
     *
     * @param updatePrepay the update prepay
     * @return the boolean
     */
    public static Boolean checkCreatePrepayForCldParameter(UpdatePrepay updatePrepay) {
        return updatePrepay.getSellSyscode() == null
                || updatePrepay.getSellmatchid() == null
                || updatePrepay.getBuySyscode() == null
                || updatePrepay.getBuymatchid() == null;
    }

    /**
     * Check search prepay for cld parameter boolean.
     *
     * @param updatePrepay the update prepay
     * @return the boolean
     */
    public static Boolean checkSearchPrepayForCldParameter(UpdatePrepay updatePrepay) {
        return updatePrepay.getSellSyscode() == null
                || updatePrepay.getSellmatchid() == null
                || updatePrepay.getBuySyscode() == null
                || updatePrepay.getBuymatchid() == null;
    }

    /**
     * Check update prepay parameter boolean.
     *
     * @param updatePrepay the update prepay
     * @return the boolean
     */
    public static Boolean checkUpdatePrepayParameter(UpdatePrepay updatePrepay) {
        return updatePrepay.getAccountid() == null
                || updatePrepay.getType() == null
                || updatePrepay.getOrigin() == null
                || updatePrepay.getAmount() == null
                || updatePrepay.getOrderid() == null;
    }

}
